auto();
var mModule = require('qxz.js');
// console.show()
// console.setPosition(200, 200);


log("加qq群")

// launchApp("QQ");
sleep(100);

// waitForPackage("com.tencent.mobileqq");

app.startActivity({
    action: "android.intent.action.VIEW",
    data: "mqqapi://card/show_pslcard?card_type=group&uin=576363773",
    packageName: "com.tencent.mobileqq",
});

waitForPackage("com.tencent.mobileqq");
waitForActivity("com.tencent.mobileqq.activity.PublicFragmentActivity");
if (className("android.widget.Button").text("申请加群").exists()) {
    var applyButton = className("android.widget.Button").text("申请加群").findOne();
    log("申请入群：" + applyButton.click());

    waitForActivity("com.tencent.mobileqq.activity.AddFriendVerifyActivity");
    var sendButton = className("android.widget.TextView").text("发送").findOne();
    log("发送信息：" + sendButton.click());
}

threads.currentThread().interrupt();

